package com.cma.cmabackend.controller;

import com.cma.cmabackend.entity.User;
import com.cma.cmabackend.entity.re.ReUser;
import com.cma.cmabackend.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;


/*
    LabAdmin : 0
    LabEmp : 1
    EquipmentDept : 2
    QualityDept : 3
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    UserService userService;

    @PostMapping("")
    public Map<String,Object> add(User user, int type) {
        return userService.add(user, type);
    }

    @GetMapping("/getall")
    public List<ReUser> getAllLabEmp() {
        return userService.getAllLabEmp();
    }
}
